home *** CD-ROM | disk | FTP | other *** search
/ Rat Attack (UK) (Digital Press Kit - Summer '99) / Rat Attack (UK) (Digital Press Kit - Summer '99).bin / RAT01.DIR / 00137_Script_Sound Play Castmember < prev    next >
Text File  |  1999-04-26  |  2KB  |  71 lines

  1. --  Sound Play Member
  2.  
  3. -- also functions through lingo by handling message 'initPlayMember', 
  4. -- for example if this behavior was assigned to sprite 5, use
  5. -- sendsprite 5, #initPlayMember
  6.  
  7. -- Media
  8. property WhichEvent, WhichSound, WhichChannel, StartImmediately
  9. property tester
  10.  
  11. on initPlayMember me
  12.   init me
  13. end
  14.  
  15.  
  16. on mouseUp me
  17.   if whichEvent = #mouseup    then init me
  18. end
  19.  
  20. on mouseDown me
  21.   if whichEvent = #mousedown  then init me
  22. end
  23.  
  24. on prepareFrame me
  25.   if whichEvent = #prepareframe then init me
  26. end
  27.  
  28. on enterFrame me
  29.   if whichEvent = #enterframe then init me
  30. end
  31.  
  32. on exitFrame me
  33.   if whichEvent = #exitframe  then init me
  34. end
  35.  
  36. on init me
  37.   puppetSound the WhichChannel of me, the whichSound of me
  38.   if the StartImmediately of me then updatestage
  39. end
  40.  
  41. ---
  42.  
  43. on getPropertyDescriptionList
  44.   
  45.   set p_list = [ ¼
  46.           #WhichSound: [ #comment:   "Sound:", ¼
  47.                           #format:   #sound, ¼
  48.                          #default:   "" ], ¼
  49.         #WhichChannel: [ #comment:   "Channel:", ¼
  50.                           #format:   #integer, ¼
  51.                          #default:    1 ], ¼
  52.           #WhichEvent: [ #comment:   "Initializing Event:", ¼
  53.                           #format:   #symbol, ¼
  54.                            #range: [ #MouseUp, #MouseDown, #PrepareFrame, #EnterFrame, #ExitFrame, #InitPlayMember ], ¼
  55.                          #default:   #MouseUp ]¼
  56.                  ]
  57.   return p_list
  58.   
  59. end
  60.  
  61. on getBehaviorDescription
  62.   return ¼
  63. "Plays the designated sound cast member when the specified event occurs, or when the message ." & RETURN & ¼
  64. "PARAMETERS:" & RETURN & ¼
  65. "ò Sound - Choose the sound cast member to be played."  & RETURN & ¼
  66. "ò Channel - Enter the sound channel number to be used for playback."  & RETURN & ¼
  67. "ò Initializing Event - Specify the event that triggers the behavior."
  68.   
  69. end
  70.  
  71.